<?php

/**
 * category actions.
 *
 * @package    jobeet
 * @subpackage category
 * @author     Miguel Angel Ahumada Santibáñez
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class categoryActions extends sfActions {

    /**
     * Executes index action, no es necesario ya que no tiene invocación por index
     *
     * @param sfRequest $request A request object
     */
    public function executeIndex(sfWebRequest $request) {
        $this->forward('default', 'module');
    }

    /**
     * se agrega un paginador al cual se le pasa el objeto doctrine
     */
    public function executeShow(sfWebRequest $request) {
        $this->category = $this->getRoute()->getObject();

        $this->pager = new sfDoctrinePager(
                        'JobeetJob',
                        sfConfig::get('app_max_jobs_on_category')
        );
        $this->pager->setQuery($this->category->getActiveJobsQuery());
        $this->pager->setPage($request->getParameter('page', 1));
        $this->pager->init();
    }

}
